<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - Kubernetes Client</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/kubernetes-client" />
  <meta property="og:title" content="Quarkus - Kubernetes Client" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/kubernetes-client">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - Kubernetes Client</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#configuration">Configuration</a></li>
<li><a href="#usage">Usage</a>
<ul class="sectlevel2">
<li><a href="#overriding">Overriding</a></li>
</ul>
</li>
<li><a href="#testing">Testing</a></li>
<li><a href="#note-on-implementing-the-watcher-interface">Note on implementing the Watcher interface</a></li>
<li><a href="#access-to-the-kubernetes-api">Access to the Kubernetes API</a></li>
<li><a href="#configuration-reference">Configuration Reference</a></li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Quarkus includes the <code>kubernetes-client</code> extension which enables the use of the <a href="https://github.com/fabric8io/kubernetes-client">Fabric8 Kubernetes Client</a>
in native mode while also making it easier to work with.</p>
</div>
<div class="paragraph">
<p>Having a Kubernetes Client extension in Quarkus is very useful in order to unlock the power of Kubernetes Operators.
Kubernetes Operators are quickly emerging as a new class of Cloud Native applications.
These applications essentially watch the Kubernetes API and react to changes on various resources and can be used to manage the lifecycle of all kinds of complex systems like databases, messaging systems and much much more.
Being able to write such operators in Java with the very low footprint that native images provide is a great match.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuration"><a class="anchor" href="#configuration"></a>Configuration</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Once you have your Quarkus project configured you can add the <code>kubernetes-client</code> extension
to your project by running the following command in your project base directory.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">./mvnw quarkus:add-extension -Dextensions="kubernetes-client"</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will add the following to your <code>pom.xml</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-kubernetes-client&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="usage"><a class="anchor" href="#usage"></a>Usage</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Quarkus configures a Bean of type <code>KubernetesClient</code> which can be injected into application code using the well known CDI methods.
This client can be configured using various properties as can be seen in the following example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">quarkus.kubernetes-client.trust-certs=false
quarkus.kubernetes-client.namespace=default</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that the full list of properties is available in the <a href="https://github.com/quarkusio/quarkus/blob/master/extensions/kubernetes-client/runtime-internal/src/main/java/io/quarkus/kubernetes/client/runtime/KubernetesClientBuildConfig.java">KubernetesClientBuildConfig</a> class.</p>
</div>
<div class="sect2">
<h3 id="overriding"><a class="anchor" href="#overriding"></a>Overriding</h3>
<div class="paragraph">
<p>The extension also allows application code to override either of  <code>io.fabric8.kubernetes.client.Config</code> or <code>io.fabric8.kubernetes.client.KubernetesClient</code> which are
normally provided by the extension by simply declaring custom versions of those beans.</p>
</div>
<div class="paragraph">
<p>An example of this can be seen in the following snippet:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">@ApplicationScoped
public class KubernetesClientProducer {

    @Produces
    public KubernetesClient kubernetesClient() {
        // here you would create a custom client
        return new DefaultKubernetesClient();
    }
}</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="testing"><a class="anchor" href="#testing"></a>Testing</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To make testing against a mock Kubernetes API extremely simple, Quarkus provides the <code>KubernetesMockServerTestResource</code> which automatically launches
a mock of the Kubernetes API server and sets the proper environment variables needed so that the Kubernetes Client configures itself to use said mock.
Tests can inject the mock and set it up in any way necessary for the particular testing using the <code>@MockServer</code> annotation.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s assume we have a REST endpoint defined like so:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="java" class="language-java hljs">@Path("/pod")
public class Pods {

    private final KubernetesClient kubernetesClient;

    public Pods(KubernetesClient kubernetesClient) {
        this.kubernetesClient = kubernetesClient;
    }

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{namespace}")
    public List&lt;Pod&gt; pods(@PathParam("namespace") String namespace) {
        return kubernetesClient.pods().inNamespace(namespace).list().getItems();
    }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>We could write a test for this endpoint very easily like so:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="java" class="language-java hljs">@QuarkusTestResource(KubernetesMockServerTestResource.class)
@QuarkusTest
public class KubernetesClientTest {

    @MockServer
    KubernetesMockServer mockServer;

    @BeforeEach
    public void before() {
        final Pod pod1 = new PodBuilder().withNewMetadata().withName("pod1").withNamespace("test").and().build();
        final Pod pod2 = new PodBuilder().withNewMetadata().withName("pod2").withNamespace("test").and().build();

        mockServer.expect().get().withPath("/api/v1/namespaces/test/pods")
                .andReturn(200,
                        new PodListBuilder().withNewMetadata().withResourceVersion("1").endMetadata().withItems(pod1, pod2)
                                .build())
                .always();
    }

    @Test
    public void testInteractionWithAPIServer() {
        RestAssured.when().get("/pod/test").then()
                .body("size()", is(2));
    }

}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that to take advantage of these features, the <code>quarkus-test-kubernetes-client</code> dependency needs to be added, for example like so:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-test-kubernetes-client&lt;/artifactId&gt;
    &lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="note-on-implementing-the-watcher-interface"><a class="anchor" href="#note-on-implementing-the-watcher-interface"></a>Note on implementing the Watcher interface</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Due to the restrictions imposed by GraalVM, extra care needs to be taken when implementing a <code>io.fabric8.kubernetes.client.Watcher</code> if the application is intended to work in native mode.
Essentially every <code>Watcher</code> implementation needs to specify the Kubernetes model class that it handles via the <code>Watcher</code>'s generic type at class definition time.
To better understand this, suppose we want to watch for changes to Kubernetes <code>Pod</code> resources. There are a couple ways to write such a <code>Watcher</code> that are guaranteed to work in native:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="java" class="language-java hljs">client.pods().watch(new Watcher&lt;Pod&gt;() {
    @Override
    public void eventReceived(Action action, Pod pod) {
        // do something
    }

    @Override
    public void onClose(KubernetesClientException e) {
        // do something
    }
});</code></pre>
</div>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="java" class="language-java hljs">public class PodResourceWatcher implements Watcher&lt;Pod&gt; {
    @Override
    public void eventReceived(Action action, Pod pod) {
        // do something
    }

    @Override
    public void onClose(KubernetesClientException e) {
        // do something
    }
}

...


client.pods().watch(new PodResourceWatcher());</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that defining the generic type via a class hierarchy similar to the following example will also work correctly:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="java" class="language-java hljs">public abstract class MyWatcher&lt;S&gt; implements Watcher&lt;S&gt; {
}

...


client.pods().watch(new MyWatcher&lt;Pod&gt;() {
    @Override
    public void eventReceived(Action action, Pod pod) {
        // do something
    }
});</code></pre>
</div>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
The following example will <strong>not</strong> work in native mode because the generic type of watcher cannot be determined by looking at the class and method definitions
thus making Quarkus unable to properly determine the Kubernetes model class for which reflection registration is needed:
</td>
</tr>
</table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code data-lang="java" class="language-java hljs">public class ResourceWatcher&lt;T extends HasMetadata&gt; implements Watcher&lt;T&gt; {
    @Override
    public void eventReceived(Action action, T resource) {
        // do something
    }

    @Override
    public void onClose(KubernetesClientException e) {
        // do something
    }
}

client.pods().watch(new ResourceWatcher&lt;Pod&gt;());</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="access-to-the-kubernetes-api"><a class="anchor" href="#access-to-the-kubernetes-api"></a>Access to the Kubernetes API</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In many cases in order to access the Kubernetes API server a <code>ServiceAccount</code>, <code>Role</code> and <code>RoleBinding</code> will be necessary.
An example that allows listing all pods could look something like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs">---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: &lt;applicationName&gt;
  namespace: &lt;namespace&gt;
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: &lt;applicationName&gt;
  namespace: &lt;namespace&gt;
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: &lt;applicationName&gt;
  namespace: &lt;namespace&gt;
roleRef:
  kind: Role
  name: &lt;applicationName&gt;
  apiGroup: rbac.authorization.k8s.io
subjects:
  - kind: ServiceAccount
    name: &lt;applicationName&gt;
    namespace: &lt;namespace&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Replace <code>&lt;applicationName&gt;</code> and <code>&lt;namespace&gt;</code> with your values.
Have a look at <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/">Configure Service Accounts for Pods</a> to get further information.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuration-reference"><a class="anchor" href="#configuration-reference"></a>Configuration Reference</h2>
<div class="sectionbody">
<div class="paragraph configuration-legend">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> Configuration property fixed at build time - All other configuration properties are overridable at runtime</p>
</div>
<table class="tableblock frame-all grid-all stretch configuration-reference searchable">
<colgroup>
<col style="width: 80%;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-kubernetes-client_configuration"></a><a href="#quarkus-kubernetes-client_configuration">Configuration property</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.trust-certs"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.trust-certs">quarkus.kubernetes-client.trust-certs</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Whether or not the client should trust a self signed certificate if so presented by the API server</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.master-url"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.master-url">quarkus.kubernetes-client.master-url</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>URL of the Kubernetes API server</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.namespace"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.namespace">quarkus.kubernetes-client.namespace</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Default namespace to use</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.ca-cert-file"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.ca-cert-file">quarkus.kubernetes-client.ca-cert-file</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>CA certificate file</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.ca-cert-data"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.ca-cert-data">quarkus.kubernetes-client.ca-cert-data</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>CA certificate data</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.client-cert-file"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.client-cert-file">quarkus.kubernetes-client.client-cert-file</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Client certificate file</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.client-cert-data"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.client-cert-data">quarkus.kubernetes-client.client-cert-data</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Client certificate data</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-file"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-file">quarkus.kubernetes-client.client-key-file</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Client key file</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-data"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-data">quarkus.kubernetes-client.client-key-data</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Client key data</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-algo"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-algo">quarkus.kubernetes-client.client-key-algo</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Client key algorithm</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-passphrase"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.client-key-passphrase">quarkus.kubernetes-client.client-key-passphrase</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Client key passphrase</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.username"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.username">quarkus.kubernetes-client.username</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Kubernetes auth username</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.password"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.password">quarkus.kubernetes-client.password</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Kubernetes auth password</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.watch-reconnect-interval"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.watch-reconnect-interval">quarkus.kubernetes-client.watch-reconnect-interval</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Watch reconnect interval</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>PT1S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.watch-reconnect-limit"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.watch-reconnect-limit">quarkus.kubernetes-client.watch-reconnect-limit</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Maximum reconnect attempts in case of watch failure By default there is no limit to the number of reconnect attempts</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>-1</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.connection-timeout"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.connection-timeout">quarkus.kubernetes-client.connection-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Maximum amount of time to wait for a connection with the API server to be established</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>PT10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.request-timeout"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.request-timeout">quarkus.kubernetes-client.request-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Maximum amount of time to wait for a request to the API server to be completed</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>PT10S</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.rolling-timeout"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.rolling-timeout">quarkus.kubernetes-client.rolling-timeout</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Maximum amount of time in milliseconds to wait for a rollout to be completed</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html">Duration</a>
  <a href="#duration-note-anchor" title="More information about the Duration format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>PT15M</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.http-proxy"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.http-proxy">quarkus.kubernetes-client.http-proxy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>HTTP proxy used to access the Kubernetes API server</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.https-proxy"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.https-proxy">quarkus.kubernetes-client.https-proxy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>HTTPS proxy used to access the Kubernetes API server</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.proxy-username"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.proxy-username">quarkus.kubernetes-client.proxy-username</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Proxy username</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.proxy-password"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.proxy-password">quarkus.kubernetes-client.proxy-password</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Proxy password</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-client.no-proxy"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-client.no-proxy">quarkus.kubernetes-client.no-proxy</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>IP addresses or hosts to exclude from proxying</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-kubernetes-client_quarkus.kubernetes-config.secrets.enabled"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-config.secrets.enabled">quarkus.kubernetes-config.secrets.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Whether or not configuration can be read from secrets. If set to <code>true</code>, Kubernetes resources allowing access to secrets (role and role binding) will be generated.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-kubernetes-client_quarkus.kubernetes-config.enabled"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-config.enabled">quarkus.kubernetes-config.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If set to true, the application will attempt to look up the configuration from the API server</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-kubernetes-client_quarkus.kubernetes-config.fail-on-missing-config"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-config.fail-on-missing-config">quarkus.kubernetes-config.fail-on-missing-config</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If set to true, the application will not start if any of the configured config sources cannot be located</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-kubernetes-client_quarkus.kubernetes-config.config-maps"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-config.config-maps">quarkus.kubernetes-config.config-maps</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>ConfigMaps to look for in the namespace that the Kubernetes Client has been configured for</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-kubernetes-client_quarkus.kubernetes-config.secrets"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-config.secrets">quarkus.kubernetes-config.secrets</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Secrets to look for in the namespace that the Kubernetes Client has been configured for. If you use this, you probably want to enable <code>quarkus.kubernetes-config.secrets.enabled</code>.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-kubernetes-client_quarkus.kubernetes-config.namespace"></a><code><a href="#quarkus-kubernetes-client_quarkus.kubernetes-config.namespace">quarkus.kubernetes-config.namespace</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Namespace to look for config maps and secrets. If this is not specified, then the namespace configured in the kubectl config context is used. If the value is specified and the namespace doesn&#8217;t exist, the application will fail to start.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
</tbody>
</table>
<div id="duration-note-anchor" class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">About the Duration format</div>
<div class="paragraph">
<p>The format for durations uses the standard <code>java.time.Duration</code> format.
You can learn more about it in the <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-">Duration#parse() javadoc</a>.</p>
</div>
<div class="paragraph">
<p>You can also provide duration values starting with a number.
In this case, if the value consists only of a number, the converter treats the value as seconds.
Otherwise, <code>PT</code> is implicitly prepended to the value to obtain a standard <code>java.time.Duration</code> format.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
